
public class Buy {
		
	public static Player buyLot(Player a, int x) {
		
		if (LotTiles.values()[x].getCost() <= a.getCash()) {
			
			a.setCash(a.getCash()-LotTiles.values()[x].getCost()); //Decrease player's cash
			LotTiles.values()[x].setOwner(a); //Change lot's owner
		}
		
		else {
			//PROMPT
		}
		
		return a;
	}
	
	public static Player buyTrain(Player a, int x) {
		
		if (TrainTiles.values()[x].getCost() <= a.getCash()) {
			
			a.setCash(a.getCash()-TrainTiles.values()[x].getCost()); //Decrease player's cash
			TrainTiles.values()[x].setOwner(a); //Change lot's owner
			
			Properties properties = a.getProperties();
			properties.setTrainCount(properties.getTrainCount()+1);
		}
		
		else {
			//PROMPT
		}
		
		return a;
	}
	
	public static Player buyUtility(Player a, int x) {
		
		if (UtilitiesTiles.values()[x].getCost() <= a.getCash()) {
			
			a.setCash(a.getCash()-UtilitiesTiles.values()[x].getCost()); //Decrease player's cash
			UtilitiesTiles.values()[x].setOwner(a); //Change lot's owner
			
			Properties properties = a.getProperties();
			properties.setUtilityCount(properties.getUtilityCount()+1);
		}
		
		else {
			//PROMPT
		}
		
		return a;
	}
}
